const { defineConfig } = require('@vue/cli-service')
const __DEV__ = process.env.NODE_ENV === 'development'

module.exports = defineConfig({
  transpileDependencies: true,
  devServer: {
    proxy: {
      '/api': {
        target: 'http://119.3.137.222/',
        changeOrigin: true,
        pathRewrite: {
          '^/api': 'api'
        }
      },
      '/auth': {
        target: 'http://119.3.137.222/',
        changeOrigin: true,
        pathRewrite: {
          '^/auth': 'auth'
        }
      }
    }
  },
  lintOnSave: __DEV__,
  css: {
    loaderOptions: {
      less: {
        lessOptions: {
          modifyVars: {
            hack: 'true; @import "~@/styles/variables.less";'
          },
          javascriptEnabled: true
        }
      }
    }
  }
})
